package com.ligq.h265toupinpush

import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.ligq.common.utils.PermissionUtils
import com.ligq.h265toupinpush.avmetting.MeetingActivity
import com.ligq.h265toupinpush.call.CallActivity
import com.ligq.h265toupinpush.douyinclip.MixAvActivity
import com.ligq.h265toupinpush.toupin.MainActivity

@SuppressLint("CustomSplashScreen")
class SplashActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        PermissionUtils.checkPermission(this, PermissionUtils.permissions) {
            val intent = when (Const.APP_FUN) {
                Const.FUN_CALL -> {
                    Intent(this, CallActivity::class.java)
                }
                Const.FUN_TOUPIN -> {
                    Intent(this, MainActivity::class.java)
                }
                Const.FUN_MEETING -> {
                    Intent(this, MeetingActivity::class.java)
                }
                Const.FUN_MIX_AV -> {
                    Intent(this, MixAvActivity::class.java)
                }
                else -> {
                    Intent()
                }
            }
            startActivity(intent)
            finish()
        }
    }
}